from heapq import merge
import config
from dbUtils import DbUtil

from blog_core import Core

if not Core.init_flag:

    try:
        Core.launch()

        configs = config.configs

        Core.init(configs.get('blog_name'), configs.get('blog_info'), configs.get('db').get('file_name'))

        DbUtil.init(Core.db_name)

        import views

        Core.init_flag = True

    except ImportError:
        raise Exception('Error:init error...')
else:
    print("已启动")

Core.app.run(debug=True)
